﻿using System;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace MrDev.Graphics
{
    /// <summary>
    /// Controls the collision detection and response behavior of a tile.
    /// </summary>
    enum TileCollision
    {
        Passable = 0,
        Impassable = 1,
        EnterBossScreen = 2,
        ExitBossScreen = 3,
    }

    /// <summary>
    /// Stores the appearance and collision behavior of a tile.
    /// </summary>
    struct Tile
    {
        public Texture2D Texture;
        public Rectangle SourceRectangle;
        public TileCollision Collision;

        public const int Width = 48;
        public const int Height = 48;

        public static readonly Vector2 Size = new Vector2(Width, Height);

        /// <summary>
        /// Constructs a new tile.
        /// </summary>
        public Tile(Texture2D texture, Vector2 index, TileCollision collision)
        {
            Texture = texture;
            SourceRectangle = new Rectangle((int)index.X * Width, (int)index.Y * Height, 48, 48);
            Collision = collision;

        }
    }
}
